package com.jht.bletool2kotlin.widget

import android.content.Context
import android.graphics.Color
import android.util.AttributeSet
import androidx.appcompat.widget.AppCompatTextView

class ChangeColorTextView : AppCompatTextView {
    private val run =
        Runnable { super@ChangeColorTextView.setTextColor(Color.parseColor("#8A8484")) }

    constructor(context: Context?) : super(context!!) {}
    constructor(context: Context?, attrs: AttributeSet?) : super(
        context!!, attrs
    ) {
    }

    constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(
        context!!, attrs, defStyleAttr
    ) {
    }

    fun setTextColorIn2S() {
        super.setTextColor(Color.BLACK)
        removeCallbacks(run)
        postDelayed(run, 1000)
    }
}